"""tradetrends URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url,include
from django.contrib import admin
from aliexpress.views import *
from django.views.static import serve
from django.conf import settings

from aliexpress.upload import upload_image


urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', home,name='home'),
    url(r'^buy/$', buy,name='buy'),
    url(r'^downloads', downloadcsv,name='downloadcsv'),
    url(r'^ucenter/login/$', signin,name='signin'),
    url(r'^ucenter/logout/$', signout,name='signout'),
    url(r'^ucenter/changePassword/$', changePassword,name='changePassword'),
    url(r'^ucenter/recoverPassword/$', recoverPassword,name='recoverPassword'),
    url(r'^aliexpress/', include('aliexpress.urls', namespace='aliexpress')),
    url(r'^erp/', include('erp.urls', namespace='erp')),
    url(r'^system/', include('system.urls', namespace='system')),
    url(r'^ucenter/profile$', profile,name='profile'),
    url(r'^ucenter/mytask$', mytask,name='mytask'),
    url(r'^ucenter/message$', message,name='message'),
    url(r'^ucenter/favorite$', favorite,name='favorite'),
    url(r'^ucenter/monitor', monitor_products,name='monitor_products'),
    url(r'^ucenter/store/new$', monitorStoreNew,name='monitorStoreNew'),
    url(r'^ucenter/store/hot$', monitorStoreHot,name='monitorStoreHot'),
    url(r'^ucenter/mostore$', monitorStore,name='monitorStore'),
    url(r'^ucenter/mystore$', myStore,name='myStore'),
    url(r'^ucenter/myproducts$', myProducts,name='myProducts'),
    url(r'^ucenter/mail/$', mailBox,name='mailBox'),
    url(r'^ucenter/read-mail/(?P<id>.*)$', readMail,name='readMail'),
    url(r'^ucenter/read-notice/(?P<id>.*)$', readNotice,name='readNotice'),
    url(r'^ucenter/$', ucenter,name='ucenter'),
    url(r'^dashboard/$', dashboard,name='dashboard'),
    url(r'^product/(?P<productId>\w+)', product_info,name='product_info'),
    url(r'^products/$', products,name='products'),
    url(r'^saerch/$', search,name='search'),
    url(r'^analysis/$', analysis,name='analysis'),
    url(r'^logistics/import$', logistics_import,name='logistics_import'),
    url(r'^wuliu-import$', logistics_import2,name='logistics_import2'),
    url(r'^logistics/mark$', logistics_mark,name='logistics_mark'),
    url(r'^logistics/list$', logistics_list,name='logistics_list'),
    url(r'^logistics/settings$', logistics_settings,name='logistics_settings'),
    url(r'^logistics/collect', logistics_collect,name='logistics_collect'),
    url(r'^logistics/message/(?P<user_id>.*)', logistics_message,name='logistics_message'),
    url(r'^logistics/$', logistics,name='logistics'),
    url(r'^favorite/add', favorite_add,name='favorite_add'),
    url(r'^favorite/remove', favorite_remove,name='favorite_remove'),
    url(r'^article/detail/(?P<id>\d+)', article,name='article'),
    url(r'^article/list/', articleList,name='articleList'),
    url(r'^common/editWordsCategory', editWordsCategory,name='editWordsCategory'),
    url(r'^api/getinfo/', getinfo,name='getinfo'),
    url(r'^api/getPackage/', getPackage,name='getPackage'),
    url(r'^api/getyichang/', getyichang,name='getyichang'),
    url(r'^api/getyujing/', getyujing,name='getyujing'),
    url(r'^api/getpinggu/', getpinggu,name='getpinggu'),
    url(r'^api/getovertime/', getovertime,name='getovertime'),
    url(r'^api/getexceptionrate/', getExceptionRate,name='getExceptionRate'),
    url(r'^api/getnotice/', getNotice,name='getnotice'),
    url(r'^api/getmail/', getMail,name='getMail'),
    url(r'^api/save_ls/', saveLS,name='saveLS'),
    url(r'^api/getAlibaba/', getAlibaba,name='getAlibaba'),
    url(r'^api/getSupplier/', getSupplier,name='getSupplier'),
    url(r'^api/getSku/', getSku,name='getSku'),
    url(r'^remove/store/', remove_store,name='remove_store'),
    url(r'^ajax/readnotice/', readNoticeAjax,name='readNoticeAjax'),
    url(r'^ajax/getnotice/', getNoticeAjax,name='getNoticeAjax'),
    url(r'^logs$', logs,name='logs'),
    url(r'uploads/(?P<path>.*)$',serve,{"document_root":settings.MEDIA_ROOT}),
    url(r'admin/upload/(?P<dir_name>[^/]+)$',upload_image,name='upload_image'),

]
